home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / gnu / emacs_src_18_58.lha / emacs-18.58 / lisp / loadup.el < prev    next >
Lisp/Scheme  |  1992-06-02  |  5KB  |  148 lines

  1. ;Load up standardly loaded Lisp files for Emacs.
  2. ;; This is loaded into a bare Emacs to make a dumpable one.
  3. ;; Copyright (C) 1985, 1986 Free Software Foundation, Inc.
  4.  
  5. ;; This file is part of GNU Emacs.
  6.  
  7. ;; GNU Emacs is free software; you can redistribute it and/or modify
  8. ;; it under the terms of the GNU General Public License as published by
  9. ;; the Free Software Foundation; either version 1, or (at your option)
  10. ;; any later version.
  11.  
  12. ;; GNU Emacs is distributed in the hope that it will be useful,
  13. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. ;; GNU General Public License for more details.
  16.  
  17. ;; You should have received a copy of the GNU General Public License
  18. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  19. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21.  
  22. (load "subr")
  23. (garbage-collect)
  24. (load "loaddefs.el")  ;Don't get confused if someone compiled loaddefs by mistake.
  25. (garbage-collect)
  26. (load "simple")
  27. (garbage-collect)
  28. (load "help")
  29. (load "files")
  30. (garbage-collect)
  31. (load "indent")
  32. (load "window")
  33. (load "paths.el")  ;Don't get confused if someone compiled paths by mistake.
  34. (garbage-collect)
  35. (load "startup")
  36. (load "lisp")
  37. (garbage-collect)
  38. (load "page")
  39. (load "register")
  40. (garbage-collect)
  41. (load "paragraphs")
  42. (load "lisp-mode")
  43. (garbage-collect)
  44. (load "text-mode")
  45. (load "fill")
  46. (garbage-collect)
  47. (load "c-mode")
  48. (garbage-collect)
  49. (load "isearch")
  50. (garbage-collect)
  51. (load "replace")
  52. (if (eq system-type 'vax-vms)
  53.     (progn
  54.       (garbage-collect)
  55.       (load "vmsproc")))
  56. (garbage-collect)
  57. (load "abbrev")
  58. (garbage-collect)
  59. (load "buff-menu")
  60. (if (eq system-type 'vax-vms)
  61.     (progn
  62.       (garbage-collect)
  63.       (load "vms-patch")))
  64. (if (eq system-type 'amigados)
  65.     (progn
  66.       (garbage-collect)
  67.       (load "amiga-init")))
  68.  
  69. ;If you want additional libraries to be preloaded and their
  70. ;doc strings kept in the DOC file rather than in core,
  71. ;you may load them with a "site-load.el" file.
  72. ;But you must also cause them to be scanned when the DOC file
  73. ;is generated.  For VMS, you must edit ../etc/makedoc.com.
  74. ;For other systems, you must edit ../src/ymakefile.
  75. (if (load "site-load" t)
  76.     (garbage-collect))
  77.  
  78. (load "version.el")  ;Don't get confused if someone compiled version.el by mistake.
  79.  
  80. ;; Note: all compiled Lisp files loaded above this point
  81. ;; must be among the ones parsed by make-docfile
  82. ;; to construct DOC.  Any that are not processed
  83. ;; for DOC will not have doc strings in the dumped Emacs.
  84.  
  85. (message "Finding pointers to doc strings...")
  86. (if (fboundp 'dump-emacs)
  87.     (let ((name emacs-version))
  88.       (while (string-match "[^-+_.a-zA-Z0-9]+" name)
  89.     (setq name (concat (downcase (substring name 0 (match-beginning 0)))
  90.                "-"
  91.                (substring name (match-end 0)))))
  92.       (copy-file (expand-file-name "../etc/DOC")
  93.          (concat (expand-file-name "../etc/DOC-") name)
  94.          t)
  95.       (Snarf-documentation (concat "DOC-" name)))
  96.     (Snarf-documentation "DOC"))
  97. (message "Finding pointers to doc strings...done")
  98.  
  99. ;Note: You can cause additional libraries to be preloaded
  100. ;by writing a site-init.el that loads them.
  101. ;See also "site-load" above.
  102. (load "site-init" t)
  103. (garbage-collect)
  104.  
  105. (if (or (equal (nth 3 command-line-args) "dump")
  106.     (equal (nth 4 command-line-args) "dump"))
  107.     (if (eq system-type 'vax-vms)
  108.     (progn 
  109.       (message "Dumping data as file temacs.dump")
  110.       (dump-emacs "temacs.dump" "temacs")
  111.       (kill-emacs))
  112.       (if (fboundp 'dump-emacs-data)
  113.       ;; Handle the IBM RS/6000, and perhaps eventually other machines.
  114.       (progn
  115.         ;; This strange nesting is so that the variable `name'
  116.         ;; is not bound when the data is dumped.
  117.         (message "Dumping data as file ../etc/EMACS-DATA")
  118.         (dump-emacs-data "../etc/EMACS-DATA")
  119.         (kill-emacs))
  120.     (let ((name (concat "emacs-" emacs-version)))
  121.       (while (string-match "[^-+_.a-zA-Z0-9]+" name)
  122.         (setq name (concat (downcase (substring name 0 (match-beginning 0)))
  123.                    "-"
  124.                    (substring name (match-end 0)))))
  125.       (message "Dumping under names xemacs and %s" name))
  126.     (condition-case ()
  127.         (delete-file "xemacs")
  128.       (file-error nil))
  129.     (dump-emacs "xemacs" "temacs")
  130.     ;; Recompute NAME now, so that it isn't set when we dump.
  131.     (let ((name (concat "emacs-" emacs-version)))
  132.       (while (string-match "[^-+_.a-zA-Z0-9]+" name)
  133.         (setq name (concat (downcase (substring name 0 (match-beginning 0)))
  134.                    "-"
  135.                    (substring name (match-end 0)))))
  136.       (add-name-to-file "xemacs" name t))
  137.     (kill-emacs))))
  138.  
  139. ;; Avoid error if user loads some more libraries now.
  140. (setq purify-flag nil)
  141.  
  142. ;; For machines with CANNOT_DUMP defined in config.h,
  143. ;; this file must be loaded each time Emacs is run.
  144. ;; So run the startup code now.
  145.  
  146. (or (fboundp 'dump-emacs)
  147.     (eval top-level))
  148.